
 /*
class MyArray{
    public Object[] object=new Object[3];
    public Object get(int pos){
        return object[pos];
    }
    public void set(int pos,Object val){
        object[pos]=val;
    }
}
*/
/*
 class MyArray<T>{
     public T[] obj=(T[])new Object[3];
     public T get(int pos){
         return obj[pos];
     }
     public void set(,int pos,T val){
         obj[pos]=val;
     }

 }*/
 class MyArray<T>{
     public Object[]obj=new Object[3];
     public T get(int pos){
         return (T)obj[pos];
     }
     public void set(int pos,T val){
         obj[pos]=val;
     }

 }
public class Test {
    public static void main(String[] args) {
        MyArray<Integer> myarray=new MyArray<Integer>();
        myarray.set(0,10);
        myarray.set(1,20);
        myarray.set(2,40);
        int a=myarray.get(2);
        System.out.println(a);

        System.out.println("===============");

        MyArray<String> myArray2=new MyArray<String>();
        myArray2.set(0,"good");
        myArray2.set(1,"ccc");
        myArray2.set(2,"bbb");
    }
}
